/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package crawler;

import crawler.Crawling;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Putra
 */
public class UrlList {

    /**
     *menyimpan link keseluruhan setelah dilakukan crawling data
     */
    public static List<String> listUrl = new ArrayList<String>();
    private Crawling crawling;
    public UrlList(int minPage,int maxPage){
        for (int i = minPage; i <= maxPage; i++) {
            crawling = new Crawling("http://www.tabloidpulsa.co.id", "http://www.tabloidpulsa.co.id/phones?page=" + i, "href=\"/phones/");

            for (int j = 0; j < crawling.listUrl.size(); j++) {
                
                if (!listUrl.contains(crawling.listUrl.get(j))) {
                    String ret = crawling.listUrl.get(j);
                    System.out.println(ret);
                    //model.addElement(ret);
                    //jListOutput.updateUI();
                    listUrl.add(crawling.listUrl.get(j));
                }
            }
        }
    }
}
